#!/bin/bash

# = gen_all.sh
#
# Author::    takahiro
# Copyright:: takahiro
# License::   GPL
#

# == Version
#
# * 2014-02-10 1.00 (takahiro) 
#

# == Summary
# 
# This file is for
#

# == Interface
#
# * input
# **
# * output
# **
#

# == Example
#

# == Description
#
# This file is for
#


# function usage { 
#   echo "usage : $0 <HOGE>"
#   echo "ex ) $0 HOGE"
#   exit
# }
#

# while getopts "abd:h" options
# do
#   case $options in
#     a | b )
#     d     ) OPTDATA=${OPTARG} ;;
#     h | * ) usage ;;
#   esac
# done
# shift $( ( $OPTIND - 1  ) )
#


# if [ $# -ne 1 ]; then
#   usage
# fi
#
# HOGE=$1
#

INFILES=""

./script/remove_comma.sh ./data.org/225.txt | ./script/arrange.py > ./tmp/arrange.dat
echo [log] ./tmp/arrange.dat was generated.
INFILES+=" ./tmp/arrange.dat"

./script/calc_blackwhite.py ./tmp/arrange.dat > ./tmp/blackwhite.dat
echo [log] ./tmp/blackwhite.dat was generated.
INFILES+=" ./tmp/blackwhite.dat"

./script/gen_average.py ./tmp/arrange.dat 5 > ./tmp/average5.dat
echo [log] ./tmp/average5.dat was generated.
INFILES+=" ./tmp/average5.dat"

./script/gen_average.py ./tmp/arrange.dat 25 > ./tmp/average25.dat
echo [log] ./tmp/average25.dat was generated.
INFILES+=" ./tmp/average25.dat"

cat ./tmp/arrange.dat | awk '{print $4}' | ./script/judge_updown.py > ./tmp/trend.dat
echo [log] ./tmp/trend.dat was generated.
INFILES+=" ./tmp/trend.dat"

./script/judge_updown.py ./tmp/average5.dat > ./tmp/trend5.dat
echo [log] ./tmp/trend5.dat was generated.
INFILES+=" ./tmp/trend5.dat"

./script/judge_updown.py ./tmp/average25.dat > ./tmp/trend25.dat
echo [log] ./tmp/trend25.dat was generated.
INFILES+=" ./tmp/trend25.dat"

./script/gen_day.py ./tmp/arrange.dat > ./tmp/day.dat
echo [log] ./tmp/day.dat was generated.
INFILES+=" ./tmp/day.dat"

paste $INFILES > ./data/225.dat
echo [log] ./data/225.dat was generated.


